package com.p2p.terminal.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import com.p2p.terminal.dao.AreaInfoDao;
import com.p2p.terminal.po.AreaInfo;

@Repository
public class AreaInfoDaoImpl implements AreaInfoDao {

	private static final Logger logger = LoggerFactory.getLogger(AreaInfoDaoImpl.class);

	@Resource
	private JdbcTemplate jdbcTemplate;

	@Override
	public List<AreaInfo> queryAll() {
		RowMapper<AreaInfo> rowMapper = new BeanPropertyRowMapper<>(AreaInfo.class);
		String sql="select * from area_info";		
		return jdbcTemplate.query(sql, rowMapper);
	}

}
